<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE>用户登录</TITLE>
<LINK href="${pageContext.request.contextPath}/scripts/css/login.css" type=text/css rel=stylesheet>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
	<link rel="stylesheet" type="text/css"
			href="http://ump.deppon.com:8080/dpUMPPlatform-web/extjs4/resources/css/ext-all.css" />
			<style>
			 *{font-size:13px!important;}
			</style>
	<script type="text/javascript" src="http://ump.deppon.com:8080/dpUMPPlatform-web/extjs4/bootstrap.js"></script>
	<script type="text/javascript" src="http://ump.deppon.com:8080/dpUMPPlatform-web/extjs4/locale/ext-lang-zh_CN.js"></script>				
	<script type="text/javascript"
			src="${pageContext.request.contextPath}/scripts/DBUtils.js"></script>

<script>

	function init(){
		 document.form1.loginName.focus();
		 var Msg="${msg}";
		  if(Msg=="输入的用户不存在"){	
			  document.form1.loginName.focus();
		  }else if(Msg=="输入的密码不正确"){
			  document.form1.password.focus();
		  }
		  document.getElementById("span").innerHTML=Msg;
		  inchange();
	}

   var defaultValue=true;
   var fuc=function focusGet(){
   	if(defaultValue){
   		document.form1.loginName.focus();
   	}else{
   		document.form1.password.focus();
   	}
   }
 
   function KeysClick(obj, evt)
   {
      evt = (evt) ? evt : ((window.event) ? window.event : "")  
      keyCode = evt.keyCode ? evt.keyCode : (evt.which ? evt.which : evt.charCode);  
      if (keyCode == 13) 
      {
   	   document.form1.password.focus();
      }
   }
   
   function KeysClickpwd(obj, evt)
   {
      evt = (evt) ? evt : ((window.event) ? window.event : "")  
      keyCode = evt.keyCode ? evt.keyCode : (evt.which ? evt.which : evt.charCode);  
      if (keyCode == 13) 
      {  
   	   doLogin();
       }
   }
   
 /*检查用户名、密码是否输入正确，再提交*/  
 function checkAll(name, password)  
 {
   var result = true;//验证结果  
   if (name.trim()=="")  
   { 
   	showInfoMsg("账号不能为空",fuc);
    document.getElementById("span").innerHTML="";  
   	result= false;  
   } else if (password == "")  
   {   defaultValue=false;
    document.getElementById("span").innerHTML="";
   	showInfoMsg("密码不能为空",fuc);
   	
   	result= false;  
   }  
   return result;  
 }  
 
 function doLogin(){
	if(checkAll( document.form1.loginName.value, document.form1.password.value)){	
		  document.form1.submit();
	}
 }
 
/////////////鼠标滑过文本框变色、、、、、、、、、、、开始
var inchange=function change(){
 var Arrayinput = document.getElementsByTagName("input");
 for(var i=0;i<Arrayinput.length;i++){
        Arrayinput[i].onmouseover=inputOver;
 	   Arrayinput[i].onmouseout=inputOut;
 }}
 function inputOver(event){
  var event=event || window.event;
  var source = event.srcElement || event.target;
 /////////////////////////鼠标 onmouseover 时文本框里焦点在此文本框信息后
     if  (this.createTextRange)  {  
        var  r  =  this.createTextRange(); 
        r.moveStart('character',  this.value.length);  
        r.collapse();
 	   if(r.onclick){}else{r.select();}}
 ///////////////////鼠标 onmouseover 时文本框里焦点在此文本框信息后
  if(this.name=="loginName"){source.className="user_text2";}
  if(this.name=="password"){source.className="pass_text2";}
  if(this.name=="btn1"){source.className="btn2";}
  if(this.name=="btn2"){source.className="btn4";}
  }
 function inputOut(event){
  var event=event || window.event;
  var source = event.srcElement || event.target;
  if(this.name=="loginName"){source.className="user_text";}
  if(this.name=="password"){source.className="pass_text";}
  if(this.name=="btn1"){source.className="btn1"}
  if(this.name=="btn2"){source.className="btn3"}
 }
 ///////鼠标滑过文本框变色、、、、、、、、、、、结束 
</script>
</HEAD>
<BODY id=userlogin_body onload="init()">

<br>
<form action="loginAction.action" method="post" enctype="multipart/form-data" name="form1">
  <table width="574" height="315" border="0" align="center" cellpadding="0" cellspacing="0" background="${pageContext.request.contextPath}/scripts/images/form.gif" style="background-repeat: no-repeat;">
     <tr>
       <td width="266" height="135" align="right"></td>
       <td width="68">&nbsp;</td>
       <td width="68">&nbsp;</td>
       <td>&nbsp;</td>
    </tr>
    <tr>
       <td  height="45">&nbsp;</td>
       <td></td>
       <td  colspan="2"><input class="user_text"   id="loginName"   type="text" name="loginName" value="${loginName}" onKeyDown="return KeysClick(this,event)">
       </td>
    </tr>
    <tr>
   	   <td height="34">&nbsp;</td>  
   	   <td></td>    
       <td  colspan="2" oncopy="return false"><input  class="pass_text" name="password" type="password"    id="password" value="${password}"  onKeyDown="return KeysClickpwd(this,event)"></td>
    </tr>
    <tr>
      <td height="28" align="right">&nbsp;</td>
      <td>&nbsp;</td>
      <td colspan="2"><font color="red"><span id="span" name="span"></span></font></td>
    </tr>
    
    <tr>
    	 <td height="32"></td>
    	 <td  colspan="2">
         <input name="btn1" type="button" class="btn1" id="btn1"  onClick="doLogin()" style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" value="       ">
      </td>
      <td >
	     <input name="btn2" type="reset" class="btn3" id="btn2"  onClick="document.form1.loginName.focus()" style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" value="       ">
      </td>
    </tr>
   	<tr>
   	</tr>
  </table>
</form>
